package com.jiaxz.cloud.movie.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.jiaxz.cloud.movie.entity.User;
import com.jiaxz.cloud.movie.feign.UserFeignInterface;

@RestController
public class MovieController {
  /*  @Autowired
    private RestTemplate restTemplate;
    @GetMapping("/movie/findById/{id}")
    public User findById(@PathVariable("id")Long id){
        return this.restTemplate.getForObject("http://localhost/user/findById/"+id,User.class);
    }*/
	@Autowired
	UserFeignInterface userFeignInterface;
    @GetMapping("/movie/findById/{id}")
    public User findByIdFeign(@PathVariable("id")Long id){
        return this.userFeignInterface.findById(id);
    }
}
